<%@ tag pageEncoding="UTF-8" %>
<%@ taglib prefix="b" tagdir="/WEB-INF/tags/base" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fc" tagdir="/WEB-INF/tags/form" %>
<%@ taglib prefix="btn" tagdir="/WEB-INF/tags/btn" %>
<%@ attribute name="_id" type="java.lang.String" required="false" %>
<%@ attribute name="_action" type="java.lang.String" required="true" %>
<%@ attribute name="_name" type="java.lang.String" required="false" %>
<%@ attribute name="formClass" type="java.lang.String" required="false" %>
<%@ attribute name="_method" type="java.lang.String" required="false" %>
<%@ attribute name="formCol" type="java.lang.Integer" required="false" %>
<%@ attribute name="_buttons" type="java.lang.Boolean" required="false" %>

<c:set var="formCol" value="${empty formCol ? 12 : formCol}"/>

<c:if test="${not empty _name}">
    <h3 class="header smaller lighter blue">${_name}</h3>
</c:if>

<div class="col-xs-${formCol}">
    <form id="${_id}" action="${_action}" method="${empty _method?'post':_method}" class="form-horizontal ${formClass}"
          role="form">
        <div class="form-group">
            <jsp:doBody/>
        </div>
        <c:if test="${empty _buttons or _buttons eq true}">
            <b:button-group>
                <btn:submit/>
                <btn:reset/>
            </b:button-group>
        </c:if>
    </form>
</div>
